<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增物品借阅')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-borrow-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">借阅人</label>
                <div class="col-sm-8">
                    <input name="borrowUserName" class="form-control" type="text" th:value="${@permission.getPrincipalProperty('userName')}" readonly>
                </div>

            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">使用用途：</label>
                <div class="col-sm-8">
                    <input name="yongtu" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">使用时间区间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="timeQujian" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">物品名称：</label>
                <div class="col-sm-8">
                    <select id="itemId" name = "itemId"  class="form-control m-b">
                        <option th:each="item : ${items}" th:value="${item.id}"
                                th:text="${item.itemName}"></option>
                    </select>
                   <!-- <input name="ItemName" class="form-control" type="text">-->
                </div>
            </div>
            <!--<div class="form-group">
                <label class="col-sm-3 control-label">物品状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box">
                        <input type="radio" name="status" value="">
                        <label th:for="status" th:text="未知"></label>
                    </div>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>-->
            <!--<div class="form-group">
                <label class="col-sm-3 control-label">申请时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="applyTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">审核领导：</label>
                <!--<div class="col-sm-8">
                    <input name="promiseLeader" class="form-control" type="text">
                </div>-->
                <div class="col-sm-8">
                    <select id="promiseLeaderId" name = "promiseLeaderId"  class="form-control m-b">
                        <option th:each="approval : ${approvalList}" th:value="${approval.id}"
                                th:text="${approval.name}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/borrow"
        $("#form-borrow-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-borrow-add').serialize());
            }
        }

        $("input[name='timeQujian']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='applyTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>